package io;

import java.io.File;
import java.io.IOException;

public class FileCreate {
    public static void main(String[] args) {


    }

    public void create1() {
        String filePath = "c:\\test1.txt";
        File file = new File(filePath);
        try {
            file.createNewFile();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public void delete() {
        String filePath = "c:\\test1.txt";
        File file = new File(filePath);
        if(file.exists()){
            if (file.delete()){
                System.out.println("success");
            }
        }
    }

}
